home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!snorkelwacker!apple!sun-barr!newstop!sun!guinness.ias.edu.edu.
- From: vojta@guinness.ias.edu.edu. (Paul A Vojta)
- Newsgroups: comp.sources.x
- Subject: v07i053: xdvi (dvi previewer), Patch9, Part02/02
- Message-ID: <135892@sun.Eng.Sun.COM>
- Date: 17 May 90 20:38:29 GMT
- Sender: news@sun.Eng.Sun.COM
- Lines: 2374
- Approved: argv@sun.com
-
- Submitted-by: vojta@guinness.ias.edu.edu. (Paul A Vojta)
- Posting-number: Volume 7, Issue 53
- Archive-name: xdvi/patch9.2
- Patch-To: xdvi: Volume 3, Issues 37-39
- Patch-To: Volume 4, Issue 44 (xdvi, Patch4)
- Patch-To: Volume 4, Issue 96 (xdvi, dvi previewer, Patch5)
- Patch-To: Volume 5, Issue 35 (xdvi, dvi previewer, patch 6, part 1/2)
- Patch-To: Volume 5, Issue 36 (xdvi, dvi previewer, patch 6, part 2/2)
- Patch-To: Volume 6, Issue 5 (xdvi, Patch7)
- Patch-To: Volume 6, Issue 49 (xdvi, dvi previewer, patch 8)
-
- diff -cr old/xdvi.c new/xdvi.c
- *** old/xdvi.c Mon May 7 18:48:40 1990
- --- new/xdvi.c Wed May 16 19:38:54 1990
- ***************
- *** 31,50 ****
- static struct {char a[36], b, c;}
- #ifndef X10
- dv_c = {"$Header: xdvi.c (X11), patchlevel = ", '0' + PATCHLEVEL, 0};
- ! #else X10
- dv_c = {"$Header: xdvi.c (X10), patchlevel = ", '0' + PATCHLEVEL, 0};
- ! #endif X10
- ! #endif lint
-
- #ifndef ALTFONT
- #define ALTFONT "cmr10"
- ! #endif ALTFONT
-
- #ifndef A4
- #define DEFAULT_PAPER "us"
- ! #else A4
- #define DEFAULT_PAPER "a4"
- ! #endif A4
-
- #if !defined(X10) && !defined(NOTOOL)
- #define TOOLKIT
- --- 31,50 ----
- static struct {char a[36], b, c;}
- #ifndef X10
- dv_c = {"$Header: xdvi.c (X11), patchlevel = ", '0' + PATCHLEVEL, 0};
- ! #else
- dv_c = {"$Header: xdvi.c (X10), patchlevel = ", '0' + PATCHLEVEL, 0};
- ! #endif
- ! #endif /* lint */
-
- #ifndef ALTFONT
- #define ALTFONT "cmr10"
- ! #endif
-
- #ifndef A4
- #define DEFAULT_PAPER "us"
- ! #else
- #define DEFAULT_PAPER "a4"
- ! #endif
-
- #if !defined(X10) && !defined(NOTOOL)
- #define TOOLKIT
- ***************
- *** 59,76 ****
- #include <X11/Xutil.h>
- #include <X11/cursorfont.h>
- #include "xdvi.icon"
- ! #else X10
- #include <X/Xlib.h>
- ! #endif X10
-
- #ifdef TOOLKIT
- #include <X11/Intrinsic.h>
- #ifdef OLD_X11_TOOLKIT
- #include <X11/Atoms.h>
- ! #else not OLD_X11_TOOLKIT
- #include <X11/Xatom.h>
- #include <X11/StringDefs.h>
- ! #endif not OLD_X11_TOOLKIT
- #include <X11/Shell.h> /* needed for def. of XtNiconX */
- #ifndef XtSpecificationRelease
- #define XtSpecificationRelease 0
- --- 59,76 ----
- #include <X11/Xutil.h>
- #include <X11/cursorfont.h>
- #include "xdvi.icon"
- ! #else /* X10 */
- #include <X/Xlib.h>
- ! #endif /* X10 */
-
- #ifdef TOOLKIT
- #include <X11/Intrinsic.h>
- #ifdef OLD_X11_TOOLKIT
- #include <X11/Atoms.h>
- ! #else /* not OLD_X11_TOOLKIT */
- #include <X11/Xatom.h>
- #include <X11/StringDefs.h>
- ! #endif /* not OLD_X11_TOOLKIT */
- #include <X11/Shell.h> /* needed for def. of XtNiconX */
- #ifndef XtSpecificationRelease
- #define XtSpecificationRelease 0
- ***************
- *** 79,92 ****
- #include <X11/Xaw/Viewport.h>
- #ifdef BUTTONS
- #include <X11/Xaw/Command.h>
- ! #endif BUTTONS
- ! #else XtSpecificationRelease
- #include <X11/Viewport.h>
- #ifdef BUTTONS
- #include <X11/Command.h>
- ! #endif BUTTONS
- ! #endif XtSpecificationRelease
- ! #else TOOLKIT
- #define XtNumber(arr) (sizeof(arr)/sizeof(arr[0]))
- typedef int Position;
- typedef unsigned int Dimension;
- --- 79,92 ----
- #include <X11/Xaw/Viewport.h>
- #ifdef BUTTONS
- #include <X11/Xaw/Command.h>
- ! #endif
- ! #else /* XtSpecificationRelease < 4 */
- #include <X11/Viewport.h>
- #ifdef BUTTONS
- #include <X11/Command.h>
- ! #endif
- ! #endif /* XtSpecificationRelease */
- ! #else /* !TOOLKIT */
- #define XtNumber(arr) (sizeof(arr)/sizeof(arr[0]))
- typedef int Position;
- typedef unsigned int Dimension;
- ***************
- *** 93,103 ****
- #ifndef X10
- typedef unsigned int Pixel;
- #define XtPending() XPending(DISP)
- ! #else X10
- #define XtPending XPending
- #define XMoveResizeWindow XConfigureWindow
- ! #endif X10
- ! #endif TOOLKIT
-
- #include <stdio.h>
- #include <ctype.h>
- --- 93,103 ----
- #ifndef X10
- typedef unsigned int Pixel;
- #define XtPending() XPending(DISP)
- ! #else
- #define XtPending XPending
- #define XMoveResizeWindow XConfigureWindow
- ! #endif
- ! #endif /* TOOLKIT */
-
- #include <stdio.h>
- #include <ctype.h>
- ***************
- *** 106,112 ****
- #ifdef HAS_SIGIO
- #include <fcntl.h>
- #include <signal.h>
- ! #endif HAS_SIGIO
-
- #ifndef X10
- static Display *DISP;
- --- 106,112 ----
- #ifdef HAS_SIGIO
- #include <fcntl.h>
- #include <signal.h>
- ! #endif
-
- #ifndef X10
- static Display *DISP;
- ***************
- *** 124,131 ****
- #define Flush() XFlush(DISP)
- #ifndef X11HEIGHT
- #define X11HEIGHT 8 /* Height of server default font */
- ! #endif X11HEIGHT
- ! #else X10
- #define DPY
- #define GC int
- #define SetCursor(x)
- --- 124,131 ----
- #define Flush() XFlush(DISP)
- #ifndef X11HEIGHT
- #define X11HEIGHT 8 /* Height of server default font */
- ! #endif
- ! #else /* X10 */
- #define DPY
- #define GC int
- #define SetCursor(x)
- ***************
- *** 140,147 ****
- #ifndef X10FONT
- #define X10FONT "helv10b" /* Font for X10 error messages */
- #define X10HEIGHT 10
- ! #endif X10FONT
- ! #endif X10
-
- #define MAGBORD 1 /* border size for magnifier */
- char *alt_font = ALTFONT;
- --- 140,147 ----
- #ifndef X10FONT
- #define X10FONT "helv10b" /* Font for X10 error messages */
- #define X10HEIGHT 10
- ! #endif
- ! #endif /* X10 */
-
- #define MAGBORD 1 /* border size for magnifier */
- char *alt_font = ALTFONT;
- ***************
- *** 180,193 ****
- #define fore_Pixel fore_args.value
- static Arg back_args = {XtNbackground, (XtArgVal) 0};
- #define back_Pixel back_args.value
- ! #else TOOLKIT
- static Pixel fore_Pixel, back_Pixel;
- ! #endif TOOLKIT
- ! static Pixel hl_Pixel, cr_Pixel;
- ! #endif X10
-
- static char *fore_color;
- static char *back_color;
- static char *high_color;
- static char *curs_color;
- static GC foreGC, highGC;
- --- 180,194 ----
- #define fore_Pixel fore_args.value
- static Arg back_args = {XtNbackground, (XtArgVal) 0};
- #define back_Pixel back_args.value
- ! #else /* !TOOLKIT */
- static Pixel fore_Pixel, back_Pixel;
- ! #endif /* TOOLKIT */
- ! static Pixel brdr_Pixel, hl_Pixel, cr_Pixel;
- ! #endif /* X10 */
-
- static char *fore_color;
- static char *back_color;
- + static char *brdr_color;
- static char *high_color;
- static char *curs_color;
- static GC foreGC, highGC;
- ***************
- *** 194,202 ****
- #ifndef X10
- static GC ruleGC;
- static GC foreGC2;
- ! #else X10
- #define ruleGC foreGC
- ! #endif X10
-
- int page_w, page_h;
- #define clip_w mane.width
- --- 195,203 ----
- #ifndef X10
- static GC ruleGC;
- static GC foreGC2;
- ! #else /* X10 */
- #define ruleGC foreGC
- ! #endif /* X10 */
-
- int page_w, page_h;
- #define clip_w mane.width
- ***************
- *** 205,211 ****
- #ifndef X10
- static Position main_x, main_y;
- static XImage *image;
- ! #else X10
- #define main_x 0
- #define main_y 0
- static int GXfunc;
- --- 206,212 ----
- #ifndef X10
- static Position main_x, main_y;
- static XImage *image;
- ! #else /* X10 */
- #define main_x 0
- #define main_y 0
- static int GXfunc;
- ***************
- *** 215,221 ****
- */
- #include "xdvi_curs.h"
- #include "xdvi_mask.h"
- ! #endif X10
-
- static Position mag_x, mag_y, new_mag_x, new_mag_y;
- static Boolean mag_moved = False;
- --- 216,222 ----
- */
- #include "xdvi_curs.h"
- #include "xdvi_mask.h"
- ! #endif /* X10 */
-
- static Position mag_x, mag_y, new_mag_x, new_mag_y;
- static Boolean mag_moved = False;
- ***************
- *** 240,246 ****
- {XtNbottom, (XtArgVal) XtChainBottom},
- {XtNleft, (XtArgVal) XtChainLeft},
- {XtNright, (XtArgVal) XtChainRight},
- ! #endif BUTTONS
- {XtNallowHoriz, (XtArgVal) True},
- {XtNallowVert, (XtArgVal) True},
- };
- --- 241,247 ----
- {XtNbottom, (XtArgVal) XtChainBottom},
- {XtNleft, (XtArgVal) XtChainLeft},
- {XtNright, (XtArgVal) XtChainRight},
- ! #endif
- {XtNallowHoriz, (XtArgVal) True},
- {XtNallowVert, (XtArgVal) True},
- };
- ***************
- *** 319,327 ****
- {XtNheight, (XtArgVal) 30},
- {XtNcallback, (XtArgVal) command_call},
- };
- ! #endif BUTTONS
-
- ! #else TOOLKIT
- #define BAR_WID 12 /* width of darkened area */
- #define BAR_THICK 15 /* gross amount removed */
-
- --- 320,328 ----
- {XtNheight, (XtArgVal) 30},
- {XtNcallback, (XtArgVal) command_call},
- };
- ! #endif /* BUTTONS */
-
- ! #else /* !TOOLKIT */
- #define BAR_WID 12 /* width of darkened area */
- #define BAR_THICK 15 /* gross amount removed */
-
- ***************
- *** 328,334 ****
- static Window top_level;
- static Window x_bar, y_bar;
- static int x_bgn, x_end, y_bgn, y_end; /* scrollbar positions */
- ! #endif TOOLKIT
-
- /*
- * Mechanism to keep track of the magnifier window. The problems are,
- --- 329,335 ----
- static Window top_level;
- static Window x_bar, y_bar;
- static int x_bgn, x_end, y_bgn, y_end; /* scrollbar positions */
- ! #endif /* TOOLKIT */
-
- /*
- * Mechanism to keep track of the magnifier window. The problems are,
- ***************
- *** 364,380 ****
- WidgetClass viewportWidgetClass, widgetClass;
- #ifdef BUTTONS
- WidgetClass formWidgetClass, compositeWidgetClass, commandWidgetClass;
- ! #endif BUTTONS
- ! #endif TOOLKIT
- ! #else X10
- short xdvi_bits[15], xdvi_mask_bits[15];
- Display *_XlibCurrentDisplay;
- ! #endif X10
- ! #endif lint
-
- #ifdef sun
- char *sprintf();
- ! #endif sun
-
- char *malloc();
- double atof();
- --- 365,381 ----
- WidgetClass viewportWidgetClass, widgetClass;
- #ifdef BUTTONS
- WidgetClass formWidgetClass, compositeWidgetClass, commandWidgetClass;
- ! #endif /* BUTTONS */
- ! #endif /* TOOLKIT */
- ! #else /* X10 */
- short xdvi_bits[15], xdvi_mask_bits[15];
- Display *_XlibCurrentDisplay;
- ! #endif /* X10 */
- ! #endif /* lint */
-
- #ifdef sun
- char *sprintf();
- ! #endif
-
- char *malloc();
- double atof();
- ***************
- *** 412,423 ****
- XDrawLine(DISP, WINDOW(curr), ruleGC,
- fcx - curr.base_x, fcy - curr.base_y,
- tcx - curr.base_x, tcy - curr.base_y);
- ! #else X10
- XLine(WINDOW(curr),
- fcx - curr.base_x, fcy - curr.base_y,
- tcx - curr.base_x, tcy - curr.base_y,
- 1, 1, ruleGC, GXcopy, AllPlanes);
- ! #endif X10
- }
-
- /*
- --- 413,424 ----
- XDrawLine(DISP, WINDOW(curr), ruleGC,
- fcx - curr.base_x, fcy - curr.base_y,
- tcx - curr.base_x, tcy - curr.base_y);
- ! #else
- XLine(WINDOW(curr),
- fcx - curr.base_x, fcy - curr.base_y,
- tcx - curr.base_x, tcy - curr.base_y,
- 1, 1, ruleGC, GXcopy, AllPlanes);
- ! #endif
- }
-
- /*
- ***************
- *** 433,442 ****
- #ifndef X10
- XDrawPoint(DISP, WINDOW(curr), ruleGC,
- cx - curr.base_x, cy - curr.base_y);
- ! #else X10
- XPixSet(WINDOW(curr), cx - curr.base_x, cy - curr.base_y,
- 1, 1, ruleGC);
- ! #endif X10
- }
-
- /*
- --- 434,443 ----
- #ifndef X10
- XDrawPoint(DISP, WINDOW(curr), ruleGC,
- cx - curr.base_x, cy - curr.base_y);
- ! #else
- XPixSet(WINDOW(curr), cx - curr.base_x, cy - curr.base_y,
- 1, 1, ruleGC);
- ! #endif
- }
-
- /*
- ***************
- *** 464,473 ****
- #ifndef X10
- XFillRectangle(DISP, WINDOW(curr), hl ? highGC : ruleGC,
- x - curr.base_x, y - curr.base_y, w?w:1, h?h:1);
- ! #else X10
- XPixSet(WINDOW(curr), x - curr.base_x, y - curr.base_y,
- w?w:1, h?h:1, hl ? highGC : ruleGC);
- ! #endif X10
- }
- }
-
- --- 465,474 ----
- #ifndef X10
- XFillRectangle(DISP, WINDOW(curr), hl ? highGC : ruleGC,
- x - curr.base_x, y - curr.base_y, w?w:1, h?h:1);
- ! #else
- XPixSet(WINDOW(curr), x - curr.base_x, y - curr.base_y,
- w?w:1, h?h:1, hl ? highGC : ruleGC);
- ! #endif
- }
- }
-
- ***************
- *** 495,505 ****
- 0, 0,
- x - curr.base_x, y - curr.base_y,
- bitmap->w, bitmap->h);
- ! #else X10
- XBitmapBitsPut(WINDOW(curr), x - curr.base_x, y - curr.base_y,
- bitmap->w, bitmap->h, bitmap->bits,
- foreGC, backpix, NULL, GXfunc, AllPlanes);
- ! #endif X10
- }
- }
-
- --- 496,506 ----
- 0, 0,
- x - curr.base_x, y - curr.base_y,
- bitmap->w, bitmap->h);
- ! #else
- XBitmapBitsPut(WINDOW(curr), x - curr.base_x, y - curr.base_y,
- bitmap->w, bitmap->h, bitmap->bits,
- foreGC, backpix, NULL, GXfunc, AllPlanes);
- ! #endif
- }
- }
-
- ***************
- *** 654,661 ****
-
- XtGetValues(vport_widget, arg_wh, XtNumber(arg_wh));
- XtGetValues(clip_widget, arg_wh_clip, XtNumber(arg_wh_clip));
- ! x_bar = XtNameToWidget(vport_widget, "horizontal");
- ! y_bar = XtNameToWidget(vport_widget, "vertical");
- old_clip_w = clip_w;
- /* we need to do this because */
- /* sizeof(Dimension) != sizeof(int) */
- --- 655,665 ----
-
- XtGetValues(vport_widget, arg_wh, XtNumber(arg_wh));
- XtGetValues(clip_widget, arg_wh_clip, XtNumber(arg_wh_clip));
- ! /* Note: widgets may be destroyed but not forgotten */
- ! x_bar = page_w <= new_clip_w ? NULL
- ! : XtNameToWidget(vport_widget, "horizontal");
- ! y_bar = page_h <= new_clip_h ? NULL
- ! : XtNameToWidget(vport_widget, "vertical");
- old_clip_w = clip_w;
- /* we need to do this because */
- /* sizeof(Dimension) != sizeof(int) */
- ***************
- *** 713,721 ****
- keystroke(((int) client_data) & 0xff, ((int) client_data) >> 8,
- (((int) client_data) >> 8) != 0, (XEvent *) NULL);
- }
- ! #endif BUTTONS
-
- ! #else TOOLKIT
-
- /*
- * brute force scrollbar routines
- --- 717,725 ----
- keystroke(((int) client_data) & 0xff, ((int) client_data) >> 8,
- (((int) client_data) >> 8) != 0, (XEvent *) NULL);
- }
- ! #endif /* BUTTONS */
-
- ! #else /* !TOOLKIT */
-
- /*
- * brute force scrollbar routines
- ***************
- *** 803,812 ****
- mane.win = (caddr_t) XCreateSimpleWindow(DISP, top_level,
- y_thick, x_thick,
- (unsigned int) clip_w, (unsigned int) clip_h, 0,
- ! fore_Pixel, back_Pixel);
- XSelectInput(DPY WINDOW(mane), ExposureMask |
- ButtonPressMask | ButtonMotionMask | ButtonReleaseMask);
- ! #else X10
- mane.win = (caddr_t) XCreateWindow(top_level,
- y_thick, x_thick, clip_w, clip_h, 0,
- bdrmap, backmap);
- --- 807,816 ----
- mane.win = (caddr_t) XCreateSimpleWindow(DISP, top_level,
- y_thick, x_thick,
- (unsigned int) clip_w, (unsigned int) clip_h, 0,
- ! brdr_Pixel, back_Pixel);
- XSelectInput(DPY WINDOW(mane), ExposureMask |
- ButtonPressMask | ButtonMotionMask | ButtonReleaseMask);
- ! #else
- mane.win = (caddr_t) XCreateWindow(top_level,
- y_thick, x_thick, clip_w, clip_h, 0,
- bdrmap, backmap);
- ***************
- *** 813,819 ****
- XSelectInput(WINDOW(mane), ExposeRegion | ExposeCopy |
- ButtonPressed | ButtonReleased |
- LeftDownMotion | MiddleDownMotion | RightDownMotion);
- ! #endif X10
- XMapWindow(DPY WINDOW(mane));
- }
- else
- --- 817,823 ----
- XSelectInput(WINDOW(mane), ExposeRegion | ExposeCopy |
- ButtonPressed | ButtonReleased |
- LeftDownMotion | MiddleDownMotion | RightDownMotion);
- ! #endif
- XMapWindow(DPY WINDOW(mane));
- }
- else
- ***************
- *** 831,846 ****
- #ifndef X10
- x_bar = XCreateSimpleWindow(DISP, top_level, y_thick - 1, -1,
- (unsigned int) clip_w, BAR_THICK - 1, 1,
- ! fore_Pixel, back_Pixel);
- XSelectInput(DISP, x_bar,
- ExposureMask | ButtonPressMask | Button2MotionMask);
- ! #else X10
- x_bar = XCreateWindow(top_level,
- y_thick - 1, -1, clip_w, BAR_THICK - 1, 1,
- bdrmap, backmap);
- XSelectInput(x_bar,
- ExposeRegion | ButtonPressed | MiddleDownMotion);
- ! #endif X10
- XMapWindow(DPY x_bar);
- }
- x_bgn = mane.base_x * clip_w / page_w;
- --- 835,850 ----
- #ifndef X10
- x_bar = XCreateSimpleWindow(DISP, top_level, y_thick - 1, -1,
- (unsigned int) clip_w, BAR_THICK - 1, 1,
- ! brdr_Pixel, back_Pixel);
- XSelectInput(DISP, x_bar,
- ExposureMask | ButtonPressMask | Button2MotionMask);
- ! #else
- x_bar = XCreateWindow(top_level,
- y_thick - 1, -1, clip_w, BAR_THICK - 1, 1,
- bdrmap, backmap);
- XSelectInput(x_bar,
- ExposeRegion | ButtonPressed | MiddleDownMotion);
- ! #endif
- XMapWindow(DPY x_bar);
- }
- x_bgn = mane.base_x * clip_w / page_w;
- ***************
- *** 862,877 ****
- #ifndef X10
- y_bar = XCreateSimpleWindow(DISP, top_level, -1, x_thick - 1,
- BAR_THICK - 1, (unsigned int) clip_h, 1,
- ! fore_Pixel, back_Pixel);
- XSelectInput(DISP, y_bar,
- ExposureMask | ButtonPressMask | Button2MotionMask);
- ! #else X10
- y_bar = XCreateWindow(top_level,
- -1, x_thick - 1, BAR_THICK - 1, clip_h, 1,
- bdrmap, backmap);
- XSelectInput(y_bar,
- ExposeRegion | ButtonPressed | MiddleDownMotion);
- ! #endif X10
- XMapWindow(DPY y_bar);
- }
- y_bgn = mane.base_y * clip_h / page_h;
- --- 866,881 ----
- #ifndef X10
- y_bar = XCreateSimpleWindow(DISP, top_level, -1, x_thick - 1,
- BAR_THICK - 1, (unsigned int) clip_h, 1,
- ! brdr_Pixel, back_Pixel);
- XSelectInput(DISP, y_bar,
- ExposureMask | ButtonPressMask | Button2MotionMask);
- ! #else
- y_bar = XCreateWindow(top_level,
- -1, x_thick - 1, BAR_THICK - 1, clip_h, 1,
- bdrmap, backmap);
- XSelectInput(y_bar,
- ExposeRegion | ButtonPressed | MiddleDownMotion);
- ! #endif
- XMapWindow(DPY y_bar);
- }
- y_bgn = mane.base_y * clip_h / page_h;
- ***************
- *** 919,925 ****
- #define window_y 0
- #define mane_base_x mane.base_x
- #define mane_base_y mane.base_y
- ! #endif TOOLKIT
-
- static void
- compute_mag_pos(xp, yp)
- --- 923,929 ----
- #define window_y 0
- #define mane_base_x mane.base_x
- #define mane_base_y mane.base_y
- ! #endif /* TOOLKIT */
-
- static void
- compute_mag_pos(xp, yp)
- ***************
- *** 931,940 ****
- #ifndef X10
- if (t > WidthOfScreen(SCRN) - alt.width - 2*MAGBORD)
- t = WidthOfScreen(SCRN) - alt.width - 2*MAGBORD;
- ! #else X10
- ! if (t > window_w - alt.width - 2*MAGBORD)
- t = window_w - alt.width - 2*MAGBORD;
- ! #endif X10
- if (t < 0) t = 0;
- *xp = t;
- t = mag_y + main_y - alt.height/2;
- --- 935,944 ----
- #ifndef X10
- if (t > WidthOfScreen(SCRN) - alt.width - 2*MAGBORD)
- t = WidthOfScreen(SCRN) - alt.width - 2*MAGBORD;
- ! #else
- ! if (t > (int) window_w - alt.width - 2*MAGBORD)
- t = window_w - alt.width - 2*MAGBORD;
- ! #endif
- if (t < 0) t = 0;
- *xp = t;
- t = mag_y + main_y - alt.height/2;
- ***************
- *** 941,950 ****
- #ifndef X10
- if (t > HeightOfScreen(SCRN) - alt.height - 2*MAGBORD)
- t = HeightOfScreen(SCRN) - alt.height - 2*MAGBORD;
- ! #else X10
- ! if (t > window_h - alt.height - 2*MAGBORD)
- t = window_h - alt.height - 2*MAGBORD;
- ! #endif X10
- if (t < 0) t = 0;
- *yp = t;
- }
- --- 945,954 ----
- #ifndef X10
- if (t > HeightOfScreen(SCRN) - alt.height - 2*MAGBORD)
- t = HeightOfScreen(SCRN) - alt.height - 2*MAGBORD;
- ! #else
- ! if (t > (int) window_h - alt.height - 2*MAGBORD)
- t = window_h - alt.height - 2*MAGBORD;
- ! #endif
- if (t < 0) t = 0;
- *yp = t;
- }
- ***************
- *** 955,964 ****
- handle_button(widget, junk, event)
- Widget widget;
- caddr_t junk;
- ! #else TOOLKIT
- static void
- handle_button(event)
- ! #endif TOOLKIT
- XButtonEvent *event;
- {
- int x, y;
- --- 959,968 ----
- handle_button(widget, junk, event)
- Widget widget;
- caddr_t junk;
- ! #else /* !TOOLKIT */
- static void
- handle_button(event)
- ! #endif /* TOOLKIT */
- XButtonEvent *event;
- {
- int x, y;
- ***************
- *** 966,974 ****
- XSetWindowAttributes attr;
-
- alt.width = alt.height = mg_size[event->button - 1];
- ! #else X10
- alt.width = alt.height = mg_size[2 - (event->detail & ValueMask)];
- ! #endif X10
- if (alt.win != NULL || mane.shrinkfactor == 1 || alt.width <= 0)
- XBell(DISP, 20);
- else {
- --- 970,978 ----
- XSetWindowAttributes attr;
-
- alt.width = alt.height = mg_size[event->button - 1];
- ! #else
- alt.width = alt.height = mg_size[2 - (event->detail & ValueMask)];
- ! #endif
- if (alt.win != NULL || mane.shrinkfactor == 1 || alt.width <= 0)
- XBell(DISP, 20);
- else {
- ***************
- *** 977,983 ****
- #ifndef X10
- main_x = event->x_root - mag_x;
- main_y = event->y_root - mag_y;
- ! #endif X10
- compute_mag_pos(&x, &y);
- alt.base_x = (event->x + mane_base_x) * mane.shrinkfactor -
- alt.width/2;
- --- 981,987 ----
- #ifndef X10
- main_x = event->x_root - mag_x;
- main_y = event->y_root - mag_y;
- ! #endif
- compute_mag_pos(&x, &y);
- alt.base_x = (event->x + mane_base_x) * mane.shrinkfactor -
- alt.width/2;
- ***************
- *** 985,991 ****
- alt.height/2;
- #ifndef X10
- attr.save_under = True;
- ! attr.border_pixel = fore_Pixel;
- attr.background_pixel = back_Pixel;
- attr.override_redirect = True;
- alt.win = (caddr_t) XCreateWindow(DISP, RootWindowOfScreen(SCRN),
- --- 989,995 ----
- alt.height/2;
- #ifndef X10
- attr.save_under = True;
- ! attr.border_pixel = brdr_Pixel;
- attr.background_pixel = back_Pixel;
- attr.override_redirect = True;
- alt.win = (caddr_t) XCreateWindow(DISP, RootWindowOfScreen(SCRN),
- ***************
- *** 995,1006 ****
- CWSaveUnder | CWBorderPixel | CWBackPixel |
- CWOverrideRedirect, &attr);
- XSelectInput(DISP, WINDOW(alt), ExposureMask);
- ! #else X10
- alt.win = (caddr_t) XCreateWindow(WINDOW(mane),
- x, y, alt.width, alt.height, MAGBORD,
- bdrmap, backmap);
- XSelectInput(WINDOW(alt), ExposeRegion);
- ! #endif X10
- XMapWindow(DPY WINDOW(alt));
- alt_stat = 1; /* waiting for exposure */
- }
- --- 999,1010 ----
- CWSaveUnder | CWBorderPixel | CWBackPixel |
- CWOverrideRedirect, &attr);
- XSelectInput(DISP, WINDOW(alt), ExposureMask);
- ! #else
- alt.win = (caddr_t) XCreateWindow(WINDOW(mane),
- x, y, alt.width, alt.height, MAGBORD,
- bdrmap, backmap);
- XSelectInput(WINDOW(alt), ExposeRegion);
- ! #endif
- XMapWindow(DPY WINDOW(alt));
- alt_stat = 1; /* waiting for exposure */
- }
- ***************
- *** 1020,1026 ****
- main_y = event->y_root - new_mag_y;
- mag_moved = (new_mag_x != mag_x || new_mag_y != mag_y);
- }
- ! #endif TOOLKIT
-
- static void
- movemag(x, y)
- --- 1024,1030 ----
- main_y = event->y_root - new_mag_y;
- mag_moved = (new_mag_x != mag_x || new_mag_y != mag_y);
- }
- ! #endif /* TOOLKIT */
-
- static void
- movemag(x, y)
- ***************
- *** 1044,1053 ****
- Widget widget;
- caddr_t junk;
- XButtonEvent *event;
- ! #else TOOLKIT
- static void
- handle_release()
- ! #endif TOOLKIT
- {
- if (alt.win)
- if (alt_stat) alt_stat = -1; /* destroy upon expose */
- --- 1048,1057 ----
- Widget widget;
- caddr_t junk;
- XButtonEvent *event;
- ! #else /* !TOOLKIT */
- static void
- handle_release()
- ! #endif /* TOOLKIT */
- {
- if (alt.win)
- if (alt_stat) alt_stat = -1; /* destroy upon expose */
- ***************
- *** 1078,1084 ****
- alt_stat = 0;
- expose(windowrec, event->x, event->y, event->width, event->height);
- }
- ! #endif TOOLKIT
-
- /* |||
- * Currently the event handler does not coordinate XCopyArea requests
- --- 1082,1088 ----
- alt_stat = 0;
- expose(windowrec, event->x, event->y, event->width, event->height);
- }
- ! #endif /* TOOLKIT */
-
- /* |||
- * Currently the event handler does not coordinate XCopyArea requests
- ***************
- *** 1095,1102 ****
- #define XMOTION(ev) (ev).xmotion
- #define XBUTTON(ev) (ev).xbutton
- #define ISEXPOSE(ev) ((ev).type == Expose)
- ! #endif TOOLKIT
- ! #else X10
- #define XANY(ev) (ev)
- #define XCONFIG(ev) (*((XExposeEvent *) &(ev)))
- #define XEXPOSE(ev) (*((XExposeEvent *) &(ev)))
- --- 1099,1106 ----
- #define XMOTION(ev) (ev).xmotion
- #define XBUTTON(ev) (ev).xbutton
- #define ISEXPOSE(ev) ((ev).type == Expose)
- ! #endif /* TOOLKIT */
- ! #else /* X10 */
- #define XANY(ev) (ev)
- #define XCONFIG(ev) (*((XExposeEvent *) &(ev)))
- #define XEXPOSE(ev) (*((XExposeEvent *) &(ev)))
- ***************
- *** 1110,1116 ****
- #define ButtonPress ButtonPressed
- #define ButtonRelease ButtonReleased
- #define KeyPress KeyPressed
- ! #endif X10
-
- static void
- keystroke(ch, number0, arg0, eventp)
- --- 1114,1120 ----
- #define ButtonPress ButtonPressed
- #define ButtonRelease ButtonReleased
- #define KeyPress KeyPressed
- ! #endif /* X10 */
-
- static void
- keystroke(ch, number0, arg0, eventp)
- ***************
- *** 1122,1128 ****
- int next_page;
- #ifndef X10
- Window ww;
- ! #endif X10
-
- next_page = current_page;
- switch (ch) {
- --- 1126,1132 ----
- int next_page;
- #ifndef X10
- Window ww;
- ! #endif
-
- next_page = current_page;
- switch (ch) {
- ***************
- *** 1186,1192 ****
- case 'c':
- center(eventp->xkey.x, eventp->xkey.y);
- return;
- ! #else TOOLKIT
- case 'l':
- if (mane.base_x <= 0) goto bad;
- scrollmane(mane.base_x - 2 * clip_w / 3, mane.base_y);
- --- 1190,1196 ----
- case 'c':
- center(eventp->xkey.x, eventp->xkey.y);
- return;
- ! #else /* !TOOLKIT */
- case 'l':
- if (mane.base_x <= 0) goto bad;
- scrollmane(mane.base_x - 2 * clip_w / 3, mane.base_y);
- ***************
- *** 1211,1221 ****
- #ifndef X10
- XWarpPointer(DISP, None, None, 0, 0, 0, 0,
- clip_w/2 - XKEY(*eventp).x, clip_h/2 - XKEY(*eventp).y);
- ! #else X10
- XWarpMouse(WINDOW(mane), clip_w/2, clip_h/2, GXcopy);
- ! #endif X10
- return;
- ! #endif TOOLKIT
-
- #ifndef X10
- case 'M':
- --- 1215,1225 ----
- #ifndef X10
- XWarpPointer(DISP, None, None, 0, 0, 0, 0,
- clip_w/2 - XKEY(*eventp).x, clip_h/2 - XKEY(*eventp).y);
- ! #else
- XWarpMouse(WINDOW(mane), clip_w/2, clip_h/2, GXcopy);
- ! #endif
- return;
- ! #endif /* TOOLKIT */
-
- #ifndef X10
- case 'M':
- ***************
- *** 1230,1241 ****
- BitmapUnit(DISP), BitmapBitOrder(DISP),
- ImageByteOrder(DISP));
- return;
- ! #else X10
- case 'M':
- ! home_x = (XKEY(*eventp).x + mane.base_x) * mane.shrinkfactor;
- ! home_y = (XKEY(*eventp).y + mane.base_y) * mane.shrinkfactor;
- return;
- ! #endif X10
- case 's':
- if (!arg0) {
- int temp;
- --- 1234,1247 ----
- BitmapUnit(DISP), BitmapBitOrder(DISP),
- ImageByteOrder(DISP));
- return;
- ! #else
- case 'M':
- ! home_x = (XKEY(*eventp).x - (y_bar ? BAR_THICK : 0)
- ! + mane.base_x) * mane.shrinkfactor;
- ! home_y = (XKEY(*eventp).y - (x_bar ? BAR_THICK : 0)
- ! + mane.base_y) * mane.shrinkfactor;
- return;
- ! #endif
- case 's':
- if (!arg0) {
- int temp;
- ***************
- *** 1270,1279 ****
- XEvent event;
- XPeekEvent(DISP, &event);
- }
- ! #else TOOLKIT
- reconfig();
- home(False);
- ! #endif TOOLKIT
- break;
- case 'S':
- if (!arg0) goto bad;
- --- 1276,1285 ----
- XEvent event;
- XPeekEvent(DISP, &event);
- }
- ! #else /* TOOLKIT */
- reconfig();
- home(False);
- ! #endif /* TOOLKIT */
- break;
- case 'S':
- if (!arg0) goto bad;
- ***************
- *** 1307,1313 ****
-
- #ifndef X10
- #define TRSIZE 100
- ! #endif X10
- static void
- read_events(wait)
- Boolean wait;
- --- 1313,1319 ----
-
- #ifndef X10
- #define TRSIZE 100
- ! #endif /* X10 */
- static void
- read_events(wait)
- Boolean wait;
- ***************
- *** 1318,1324 ****
- XEvent event;
- #ifndef X10
- char trbuf[TRSIZE];
- ! #endif X10
- char *string;
- int nbytes;
-
- --- 1324,1330 ----
- XEvent event;
- #ifndef X10
- char trbuf[TRSIZE];
- ! #endif
- char *string;
- int nbytes;
-
- ***************
- *** 1353,1359 ****
- nbytes = XLookupString(&event.xkey, string, TRSIZE, NULL, NULL);
- if (nbytes > 1) ch = '?';
- if (nbytes != 0) ch = *string;
- ! #else TOOLKIT
-
- XNextEvent(DPY &event);
- if (XANY(event).window == WINDOW(mane) ||
- --- 1359,1365 ----
- nbytes = XLookupString(&event.xkey, string, TRSIZE, NULL, NULL);
- if (nbytes > 1) ch = '?';
- if (nbytes != 0) ch = *string;
- ! #else /* !TOOLKIT */
-
- XNextEvent(DPY &event);
- if (XANY(event).window == WINDOW(mane) ||
- ***************
- *** 1375,1383 ****
- switch (event.type) {
- #ifndef X10
- case GraphicsExpose:
- ! #else X10
- case ExposeWindow:
- ! #endif X10
- case Expose:
- #ifdef X10
- if (XEXPOSE(event).detail & ExposeCopy)
- --- 1381,1389 ----
- switch (event.type) {
- #ifndef X10
- case GraphicsExpose:
- ! #else
- case ExposeWindow:
- ! #endif
- case Expose:
- #ifdef X10
- if (XEXPOSE(event).detail & ExposeCopy)
- ***************
- *** 1384,1395 ****
- ClearArea(event.window,
- XEXPOSE(event).x, XEXPOSE(event).y,
- XEXPOSE(event).width, XEXPOSE(event).height);
- ! #endif X10
- expose(wr, XEXPOSE(event).x, XEXPOSE(event).y,
- XEXPOSE(event).width, XEXPOSE(event).height);
- #ifdef X10
- case ExposeCopy: /* throw away junk event */
- ! #endif X10
- break;
-
- case MotionNotify:
- --- 1390,1401 ----
- ClearArea(event.window,
- XEXPOSE(event).x, XEXPOSE(event).y,
- XEXPOSE(event).width, XEXPOSE(event).height);
- ! #endif
- expose(wr, XEXPOSE(event).x, XEXPOSE(event).y,
- XEXPOSE(event).width, XEXPOSE(event).height);
- #ifdef X10
- case ExposeCopy: /* throw away junk event */
- ! #endif
- break;
-
- case MotionNotify:
- ***************
- *** 1397,1403 ****
- case LeftDownMotion:
- case MiddleDownMotion:
- case RightDownMotion:
- ! #endif X10
- new_mag_x = XMOTION(event).x;
- new_mag_y = XMOTION(event).y;
- mag_moved = (new_mag_x != mag_x || new_mag_y != mag_y);
- --- 1403,1409 ----
- case LeftDownMotion:
- case MiddleDownMotion:
- case RightDownMotion:
- ! #endif
- new_mag_x = XMOTION(event).x;
- new_mag_y = XMOTION(event).y;
- mag_moved = (new_mag_x != mag_x || new_mag_y != mag_y);
- ***************
- *** 1421,1430 ****
- mane.base_y);
- #ifndef X10
- else switch (XBUTTON(event).button)
- ! #else X10
- else if (event.type == ButtonPress)
- switch (3 - (XBUTTON(event).detail & ValueMask))
- ! #endif X10
- {
- case 1:
- scrollmane(mane.base_x + XBUTTON(event).x, mane.base_y);
- --- 1427,1436 ----
- mane.base_y);
- #ifndef X10
- else switch (XBUTTON(event).button)
- ! #else
- else if (event.type == ButtonPress)
- switch (3 - (XBUTTON(event).detail & ValueMask))
- ! #endif
- {
- case 1:
- scrollmane(mane.base_x + XBUTTON(event).x, mane.base_y);
- ***************
- *** 1446,1455 ****
- XMOTION(event).y * page_h / clip_h);
- #ifndef X10
- else switch (XBUTTON(event).button)
- ! #else X10
- else if (event.type == ButtonPress)
- switch (3 - (XBUTTON(event).detail & ValueMask))
- ! #endif X10
- {
- case 1:
- scrollmane(mane.base_x, mane.base_y + XBUTTON(event).y);
- --- 1452,1461 ----
- XMOTION(event).y * page_h / clip_h);
- #ifndef X10
- else switch (XBUTTON(event).button)
- ! #else
- else if (event.type == ButtonPress)
- switch (3 - (XBUTTON(event).detail & ValueMask))
- ! #endif
- {
- case 1:
- scrollmane(mane.base_x, mane.base_y + XBUTTON(event).y);
- ***************
- *** 1485,1491 ****
- home(False);
- }
- break;
- ! #endif X10
-
- case KeyPress:
- #ifndef X10
- --- 1491,1497 ----
- home(False);
- }
- break;
- ! #endif
-
- case KeyPress:
- #ifndef X10
- ***************
- *** 1492,1505 ****
- string = trbuf;
- nbytes = XLookupString(&event.xkey, string, TRSIZE, NULL,
- NULL);
- ! #else X10
- string = XLookupMapping(&event, &nbytes);
- ! #endif X10
- if (nbytes > 1) ch = '?';
- if (nbytes != 0) ch = *string;
- break;
- }
- ! #endif TOOLKIT
- if (ch == '\0') continue;
- if (ch >= '0' && ch <= '9') {
- arg = True;
- --- 1498,1511 ----
- string = trbuf;
- nbytes = XLookupString(&event.xkey, string, TRSIZE, NULL,
- NULL);
- ! #else
- string = XLookupMapping(&event, &nbytes);
- ! #endif
- if (nbytes > 1) ch = '?';
- if (nbytes != 0) ch = *string;
- break;
- }
- ! #endif /* TOOLKIT */
- if (ch == '\0') continue;
- if (ch >= '0' && ch <= '9') {
- arg = True;
- ***************
- *** 1528,1534 ****
- char *errtext;
- #ifdef X10
- static FontInfo *font = 0;
- ! #endif X10
-
- curr = *windowrec;
- min_x = curr.min_x + curr.base_x;
- --- 1534,1540 ----
- char *errtext;
- #ifdef X10
- static FontInfo *font = 0;
- ! #endif
-
- curr = *windowrec;
- min_x = curr.min_x + curr.base_x;
- ***************
- *** 1548,1558 ****
- XDrawString(DISP, WINDOW(mane), foreGC,
- 5 - window_x, 5 + X11HEIGHT - window_y,
- errtext, strlen(errtext));
- ! #else X10
- if (!font) font = XOpenFont(X10FONT);
- XTextMask(WINDOW(mane), 5, 5 + X10HEIGHT, errtext, strlen(errtext),
- font->id, foreGC);
- ! #endif X10
- if (dvi_file) {
- Fclose(dvi_file);
- dvi_file = NULL;
- --- 1554,1564 ----
- XDrawString(DISP, WINDOW(mane), foreGC,
- 5 - window_x, 5 + X11HEIGHT - window_y,
- errtext, strlen(errtext));
- ! #else
- if (!font) font = XOpenFont(X10FONT);
- XTextMask(WINDOW(mane), 5, 5 + X10HEIGHT, errtext, strlen(errtext),
- font->id, foreGC);
- ! #endif
- if (dvi_file) {
- Fclose(dvi_file);
- dvi_file = NULL;
- ***************
- *** 1610,1618 ****
- event_freq = -1; /* forget Plan B */
- }
-
- static void
- enable_intr() {
- - #ifdef HAS_SIGIO
- int socket = ConnectionNumber(DISP);
- if (!isatty(0)) {
- puts("trying...");
- --- 1616,1624 ----
- event_freq = -1; /* forget Plan B */
- }
-
- + #ifdef HAS_SIGIO
- static void
- enable_intr() {
- int socket = ConnectionNumber(DISP);
- if (!isatty(0)) {
- puts("trying...");
- ***************
- *** 1622,1629 ****
- (void) signal(SIGIO, handle_intr);
- (void) fcntl(socket, F_SETOWN, getpid());
- (void) fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | FASYNC);
- - #endif HAS_SIGIO
- }
-
- static
- do_pages()
- --- 1628,1635 ----
- (void) signal(SIGIO, handle_intr);
- (void) fcntl(socket, F_SETOWN, getpid());
- (void) fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | FASYNC);
- }
- + #endif /* HAS_SIGIO */
-
- static
- do_pages()
- ***************
- *** 1631,1647 ****
- if (debug & DBG_BATCH) {
- #ifdef TOOLKIT
- while (mane.min_x == MAXDIM) read_events(True);
- ! #else TOOLKIT
- while (mane.min_x == MAXDIM)
- if (setjmp(canit_env)) break;
- else read_events(True);
- ! #endif TOOLKIT
- for (current_page = 0; current_page < total_pages; ++current_page)
- redraw_page();
- exit(0);
- }
- else { /* normal operation */
- enable_intr();
- (void) setjmp(canit_env);
- for (;;) {
- if (mane.win) SetCursor(ready_cursor);
- --- 1637,1655 ----
- if (debug & DBG_BATCH) {
- #ifdef TOOLKIT
- while (mane.min_x == MAXDIM) read_events(True);
- ! #else /* !TOOLKIT */
- while (mane.min_x == MAXDIM)
- if (setjmp(canit_env)) break;
- else read_events(True);
- ! #endif /* TOOLKIT */
- for (current_page = 0; current_page < total_pages; ++current_page)
- redraw_page();
- exit(0);
- }
- else { /* normal operation */
- + #ifdef HAS_SIGIO
- enable_intr();
- + #endif
- (void) setjmp(canit_env);
- for (;;) {
- if (mane.win) SetCursor(ready_cursor);
- ***************
- *** 1672,1695 ****
- static
- usage() {
- #ifndef X10
- fputs("\
- ! Usage: xdvi [+[<page>]] [-s <shrink>] [-S <density>] [-p <pixels>] [-l] [-rv]\n\
- [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
- [-cr <color>]\n\
- ! [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
- [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
- ! [#<geometry>] [-geometry <geometry>] [-display <host:display>]\n\
- ! [-copy] [-thorough] dvi_file\n", stderr);
- ! #else X10
- fputs("\
- - Usage: xdvi [+[<page>]] [-s <shrink>] [-S <density>] [-p <pixels>] [-l] [-rv]\n\
- [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
- [-cr <color>]\n\
- ! [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
- [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
- ! [-geometry <geometry> | =<geometry>]\n\
- [-display <host:display> | <host:display>] dvi_file\n", stderr);
- ! #endif X10
- exit(1);
- }
-
- --- 1680,1720 ----
- static
- usage() {
- #ifndef X10
- + #ifndef VMS
- fputs("\
- ! Usage: xdvi [+[<page>]] [-s <shrink>] [-S <density>] [-p <pixels>] [-l]\n\
- ! [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
- ! [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>] [-rv]\
- ! \n\
- [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
- [-cr <color>]\n\
- ! [-bw <width>] [-geometry <geometry>] [-icongeometry <geometry>]\n\
- ! [-iconic] [-display <host:display>] [-copy] [-thorough] dvi_file\n",
- ! stderr);
- ! #else /* VMS */
- ! fputs("\
- ! Usage: xdvi [+[<page>]] [-s <shrink>] [-density <%>] [-p <pixels>] [-l]\n\
- [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
- ! [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>] [-rv]\
- ! \n", stderr);
- fputs("\
- [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
- [-cr <color>]\n\
- ! [-bw <width>] [-geometry <geometry>] [-icongeometry <geometry>]\n\
- ! [-iconic] [-display <host:display>] [-copy] [-thorough] dvi_file\n",
- ! stderr);
- ! #endif /* VMS */
- ! #else /* X10 */
- ! fputs("\
- ! Usage: xdvi [+[<page>]] [-s <shrink>] [-S <density>] [-p <pixels>] [-l]\n\
- [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
- ! [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>] [-rv]\
- ! \n\
- ! [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
- ! [-cr <color>]\n\
- ! [-bw <width>] [-geometry <geometry> | =<geometry>]\n\
- [-display <host:display> | <host:display>] dvi_file\n", stderr);
- ! #endif /* X10 */
- exit(1);
- }
-
- ***************
- *** 1701,1715 ****
- static char *icon_geometry;
- static Boolean copy = 2;
- static Boolean thorough;
- ! #endif X10
-
- #ifdef TOOLKIT
-
- static XrmOptionDescRec options[] = {
- {"-d", ".debugLevel", XrmoptionSepArg, (caddr_t) NULL},
- - {"+", ".gotoPage", XrmoptionStickyArg, (caddr_t) NULL},
- {"-s", ".shrinkFactor", XrmoptionSepArg, (caddr_t) NULL},
- {"-S", ".densityPercent", XrmoptionSepArg, (caddr_t) NULL},
- {"-p", ".pixelsPerInch", XrmoptionSepArg, (caddr_t) NULL},
- {"-margins", ".margins", XrmoptionSepArg, (caddr_t) NULL},
- {"-sidemargin", ".sideMargin", XrmoptionSepArg, (caddr_t) NULL},
- --- 1726,1742 ----
- static char *icon_geometry;
- static Boolean copy = 2;
- static Boolean thorough;
- ! #endif /* X10 */
-
- #ifdef TOOLKIT
-
- static XrmOptionDescRec options[] = {
- {"-d", ".debugLevel", XrmoptionSepArg, (caddr_t) NULL},
- {"-s", ".shrinkFactor", XrmoptionSepArg, (caddr_t) NULL},
- + #ifndef VMS
- {"-S", ".densityPercent", XrmoptionSepArg, (caddr_t) NULL},
- + #endif
- + {"-density", ".densityPercent", XrmoptionSepArg, (caddr_t) NULL},
- {"-p", ".pixelsPerInch", XrmoptionSepArg, (caddr_t) NULL},
- {"-margins", ".margins", XrmoptionSepArg, (caddr_t) NULL},
- {"-sidemargin", ".sideMargin", XrmoptionSepArg, (caddr_t) NULL},
- ***************
- *** 1724,1730 ****
- {"-background", ".background", XrmoptionSepArg, (caddr_t) NULL},
- {"-hl", ".highlight", XrmoptionSepArg, (caddr_t) NULL},
- {"-cr", ".cursorColor", XrmoptionSepArg, (caddr_t) NULL},
- ! {"#", ".iconGeometry",XrmoptionStickyArg, (caddr_t) NULL},
- {"-copy", ".copy", XrmoptionNoArg, (caddr_t) "on"},
- {"+copy", ".copy", XrmoptionNoArg, (caddr_t) "off"},
- {"-thorough", ".thorough", XrmoptionNoArg, (caddr_t) "on"},
- --- 1751,1757 ----
- {"-background", ".background", XrmoptionSepArg, (caddr_t) NULL},
- {"-hl", ".highlight", XrmoptionSepArg, (caddr_t) NULL},
- {"-cr", ".cursorColor", XrmoptionSepArg, (caddr_t) NULL},
- ! {"-icongeometry",".iconGeometry",XrmoptionSepArg, (caddr_t) NULL},
- {"-copy", ".copy", XrmoptionNoArg, (caddr_t) "on"},
- {"+copy", ".copy", XrmoptionNoArg, (caddr_t) "off"},
- {"-thorough", ".thorough", XrmoptionNoArg, (caddr_t) "on"},
- ***************
- *** 1740,1747 ****
- static XtResource resources[] = {
- {"debugLevel", "DebugLevel", XtRString, sizeof(char *),
- (Cardinal) &debug_arg, XtRString, NULL},
- - {"gotoPage", "GotoPage", XtRString, sizeof(char *),
- - (Cardinal) &curr_page, XtRString, NULL},
- {"shrinkFactor", "ShrinkFactor", XtRInt, sizeof(int),
- (Cardinal) &shrink_factor, XtRInt, (caddr_t) &shrink_factor},
- {"densityPercent", "DensityPercent", XtRInt, sizeof(int),
- --- 1767,1772 ----
- ***************
- *** 1770,1775 ****
- --- 1795,1804 ----
- (Cardinal)&back_Pixel, XtRPixel, (caddr_t) &back_Pixel},
- {"background", "Background", XtRString, sizeof(char *),
- (Cardinal)&back_color, XtRString, NULL},
- + {"borderColor", "BorderColor", XtRPixel, sizeof(Pixel),
- + (Cardinal)&brdr_Pixel, XtRPixel, (caddr_t) &brdr_Pixel},
- + {"borderColor", "BorderColor", XtRString, sizeof(char *),
- + (Cardinal)&brdr_color, XtRString, NULL},
- {"highlight", "Highlight", XtRPixel, sizeof(Pixel),
- (Cardinal)&hl_Pixel, XtRPixel, (caddr_t) &hl_Pixel},
- {"highlight", "Highlight", XtRString, sizeof(char *),
- ***************
- *** 1810,1822 ****
- {XtNinput, (XtArgVal) True},
- };
-
- ! #else TOOLKIT
-
- static char *display;
- static char *geometry;
- - #ifdef X10
- - static char *brdr_color;
- - #endif X10
-
- #ifndef X10
- static Boolean iconic = False;
- --- 1839,1848 ----
- {XtNinput, (XtArgVal) True},
- };
-
- ! #else /* !TOOLKIT */
-
- static char *display;
- static char *geometry;
-
- #ifndef X10
- static Boolean iconic = False;
- ***************
- *** 1846,1852 ****
- }
- return color.pixel;
- }
- ! #endif X10
-
- static struct option {
- char *name;
- --- 1872,1878 ----
- }
- return color.pixel;
- }
- ! #endif /* X10 */
-
- static struct option {
- char *name;
- ***************
- *** 1861,1866 ****
- --- 1887,1893 ----
- {"+", NULL, StickyArg, StringArg, (caddr_t) &curr_page},
- {"-s", "shrinkFactor", SepArg, NumberArg, (caddr_t) &shrink_factor},
- {"-S", "densityPercent", SepArg, NumberArg, (caddr_t) &density},
- + {"-density", NULL, SepArg, NumberArg, (caddr_t) &density},
- {"-p", "pixelsPerInch", SepArg, NumberArg, (caddr_t) &pixels_per_inch},
- {"-margins", "margins", SepArg, StringArg, (caddr_t) &margins},
- {"-sidemargin", "sideMargin", SepArg, StringArg, (caddr_t) &sidemargin},
- ***************
- *** 1877,1891 ****
- {"-foreground", NULL, SepArg, StringArg, (caddr_t) &fore_color},
- {"-bg", "background", SepArg, StringArg, (caddr_t) &back_color},
- {"-background", NULL, SepArg, StringArg, (caddr_t) &back_color},
- - {"-hl", "highlight", SepArg, StringArg, (caddr_t) &high_color},
- - #ifdef X10
- {"-bd", "borderColor", SepArg, StringArg, (caddr_t) &brdr_color},
- ! #endif X10
- {"-cr", "cursorColor", SepArg, StringArg, (caddr_t) &curs_color},
- {"-geometry", "geometry", SepArg, StringArg, (caddr_t) &geometry},
- {"=", NULL, StickyArg, StringArg, (caddr_t) &geometry},
- ! #ifndef X10
- ! {"#", "iconGeometry", StickyArg, StringArg, (caddr_t) &icon_geometry},
- {"-iconic", "iconic", TrueArg, BooleanArg, (caddr_t) &iconic},
- {"+iconic", NULL, FalseArg, BooleanArg, (caddr_t) &iconic},
- {"-copy", "copy", TrueArg, BooleanArg, (caddr_t) ©},
- --- 1904,1919 ----
- {"-foreground", NULL, SepArg, StringArg, (caddr_t) &fore_color},
- {"-bg", "background", SepArg, StringArg, (caddr_t) &back_color},
- {"-background", NULL, SepArg, StringArg, (caddr_t) &back_color},
- {"-bd", "borderColor", SepArg, StringArg, (caddr_t) &brdr_color},
- ! {"-bordercolor",NULL, SepArg, StringArg, (caddr_t) &brdr_color},
- ! {"-hl", "highlight", SepArg, StringArg, (caddr_t) &high_color},
- {"-cr", "cursorColor", SepArg, StringArg, (caddr_t) &curs_color},
- {"-geometry", "geometry", SepArg, StringArg, (caddr_t) &geometry},
- + #ifdef X10
- {"=", NULL, StickyArg, StringArg, (caddr_t) &geometry},
- ! #endif
- ! #ifndef X10
- ! {"-icongeometry","iconGeometry",StickyArg, StringArg, (caddr_t) &icon_geometry},
- {"-iconic", "iconic", TrueArg, BooleanArg, (caddr_t) &iconic},
- {"+iconic", NULL, FalseArg, BooleanArg, (caddr_t) &iconic},
- {"-copy", "copy", TrueArg, BooleanArg, (caddr_t) ©},
- ***************
- *** 1892,1898 ****
- {"+copy", NULL, FalseArg, BooleanArg, (caddr_t) ©},
- {"-thorough", "thorough", TrueArg, BooleanArg, (caddr_t) &thorough},
- {"+thorough", NULL, FalseArg, BooleanArg, (caddr_t) &thorough},
- ! #endif X10
- {"-mgs", NULL, SepArg, NumberArg, (caddr_t) &mg_size[0]},
- {"-mgs1", "magnifierSize1",SepArg, NumberArg, (caddr_t) &mg_size[0]},
- {"-mgs2", "magnifierSize2",SepArg, NumberArg, (caddr_t) &mg_size[1]},
- --- 1920,1926 ----
- {"+copy", NULL, FalseArg, BooleanArg, (caddr_t) ©},
- {"-thorough", "thorough", TrueArg, BooleanArg, (caddr_t) &thorough},
- {"+thorough", NULL, FalseArg, BooleanArg, (caddr_t) &thorough},
- ! #endif /* X10 */
- {"-mgs", NULL, SepArg, NumberArg, (caddr_t) &mg_size[0]},
- {"-mgs1", "magnifierSize1",SepArg, NumberArg, (caddr_t) &mg_size[0]},
- {"-mgs2", "magnifierSize2",SepArg, NumberArg, (caddr_t) &mg_size[1]},
- ***************
- *** 1900,1906 ****
- #ifndef X10
- {"-mgs4", "magnifierSize3",SepArg, NumberArg, (caddr_t) &mg_size[3]},
- {"-mgs5", "magnifierSize3",SepArg, NumberArg, (caddr_t) &mg_size[4]},
- ! #endif X10
- };
-
- /*
- --- 1928,1934 ----
- #ifndef X10
- {"-mgs4", "magnifierSize3",SepArg, NumberArg, (caddr_t) &mg_size[3]},
- {"-mgs5", "magnifierSize3",SepArg, NumberArg, (caddr_t) &mg_size[4]},
- ! #endif
- };
-
- /*
- ***************
- *** 1945,1950 ****
- --- 1973,1979 ----
- }
- }
- if (candidate == NULL) {
- + #ifdef X10
- if (**arg == '-') usage();
- if (index(*arg, ':') != NULL) { /* display */
- --arg;
- ***************
- *** 1951,1956 ****
- --- 1980,1988 ----
- candidate = options;
- }
- else if (dvi_name) usage();
- + #else
- + if (**arg == '-' || dvi_name) usage();
- + #endif
- else {
- dvi_name = *arg;
- continue;
- ***************
- *** 1980,1997 ****
- if ((DISP = XOpenDisplay(display)) == NULL)
- oops("Can't open display");
- SCRN = DefaultScreenOfDisplay(DISP);
- ! #else X10
- if (XOpenDisplay(display) == NULL)
- oops("Can't open display");
- ! #endif X10
- for (opt = options; opt < options + XtNumber(options); ++opt)
- if (opt->resource &&
- #ifndef X10
- ((optstring = XGetDefault(DISP, prog, opt->resource)) ||
- (optstring = XGetDefault(DISP, "XDvi", opt->resource))))
- ! #else X10
- (optstring = XGetDefault(DPY prog, opt->resource)))
- ! #endif X10
- switch (opt->argtype) {
- case StringArg:
- *((char **) opt->address) = optstring;
- --- 2012,2029 ----
- if ((DISP = XOpenDisplay(display)) == NULL)
- oops("Can't open display");
- SCRN = DefaultScreenOfDisplay(DISP);
- ! #else
- if (XOpenDisplay(display) == NULL)
- oops("Can't open display");
- ! #endif
- for (opt = options; opt < options + XtNumber(options); ++opt)
- if (opt->resource &&
- #ifndef X10
- ((optstring = XGetDefault(DISP, prog, opt->resource)) ||
- (optstring = XGetDefault(DISP, "XDvi", opt->resource))))
- ! #else
- (optstring = XGetDefault(DPY prog, opt->resource)))
- ! #endif
- switch (opt->argtype) {
- case StringArg:
- *((char **) opt->address) = optstring;
- ***************
- *** 2005,2011 ****
- }
- }
-
- ! #endif TOOLKIT
-
- static char *paper_types[] = {
- "us", "8.5x11",
- --- 2037,2043 ----
- }
- }
-
- ! #endif /* TOOLKIT */
-
- static char *paper_types[] = {
- "us", "8.5x11",
- ***************
- *** 2116,2135 ****
- {
-
- #ifdef TOOLKIT
- Widget form_widget;
- Widget right_widget;
- ! #else TOOLKIT
- #ifndef X10
- XSizeHints size_hints;
- XWMHints wmhints;
- ! #else X10
- OpaqueFrame frame;
- char def[32];
- int mouspix;
- Color cdef;
- int x_thick, y_thick;
- ! #endif X10
- ! #endif TOOLKIT
- int screen_w, screen_h;
-
- #ifndef VMS
- --- 2148,2169 ----
- {
-
- #ifdef TOOLKIT
- + #ifdef BUTTONS
- Widget form_widget;
- Widget right_widget;
- ! #endif
- ! #else /* !TOOLKIT */
- #ifndef X10
- XSizeHints size_hints;
- XWMHints wmhints;
- ! #else
- OpaqueFrame frame;
- char def[32];
- int mouspix;
- Color cdef;
- int x_thick, y_thick;
- ! #endif
- ! #endif /* TOOLKIT */
- int screen_w, screen_h;
-
- #ifndef VMS
- ***************
- *** 2146,2153 ****
- #ifdef TOOLKIT
- top_level = XtInitialize(prog, "XDvi", options, XtNumber(options),
- &argc, argv);
- ! if (argc != 2) usage();
- ! dvi_name = argv[1];
-
- XtGetApplicationResources(top_level, (caddr_t) NULL, resources,
- XtNumber(resources), NULL, 0);
- --- 2180,2192 ----
- #ifdef TOOLKIT
- top_level = XtInitialize(prog, "XDvi", options, XtNumber(options),
- &argc, argv);
- ! while (--argc > 0) {
- ! if (*(*++argv) == '+')
- ! if (curr_page != NULL) usage();
- ! else curr_page = *argv + 1;
- ! else if (dvi_name != NULL) usage();
- ! else dvi_name = *argv;
- ! }
-
- XtGetApplicationResources(top_level, (caddr_t) NULL, resources,
- XtNumber(resources), NULL, 0);
- ***************
- *** 2155,2173 ****
- DISP = XtDisplay(top_level);
- SCRN = XtScreen(top_level);
-
- ! #else TOOLKIT
-
- parse_options(argc, argv);
- #ifndef X10
- if (fore_color) fore_Pixel = string_to_pixel(&fore_color);
- if (back_color) back_Pixel = string_to_pixel(&back_color);
- if (high_color) hl_Pixel = string_to_pixel(&high_color);
- if (curs_color) cr_Pixel = string_to_pixel(&curs_color);
- ! #endif X10
- if (shrink_factor <= 0 || density <= 0 || pixels_per_inch <= 0 ||
- dvi_name == NULL) usage();
-
- ! #endif TOOLKIT
-
- if (shrink_factor != 1) bak_shrink = shrink_factor;
- mane.shrinkfactor = shrink_factor;
- --- 2194,2213 ----
- DISP = XtDisplay(top_level);
- SCRN = XtScreen(top_level);
-
- ! #else /* !TOOLKIT */
-
- parse_options(argc, argv);
- #ifndef X10
- if (fore_color) fore_Pixel = string_to_pixel(&fore_color);
- if (back_color) back_Pixel = string_to_pixel(&back_color);
- + if (brdr_color) brdr_Pixel = string_to_pixel(&brdr_color);
- if (high_color) hl_Pixel = string_to_pixel(&high_color);
- if (curs_color) cr_Pixel = string_to_pixel(&curs_color);
- ! #endif
- if (shrink_factor <= 0 || density <= 0 || pixels_per_inch <= 0 ||
- dvi_name == NULL) usage();
-
- ! #endif /* TOOLKIT */
-
- if (shrink_factor != 1) bak_shrink = shrink_factor;
- mane.shrinkfactor = shrink_factor;
- ***************
- *** 2200,2205 ****
- --- 2240,2246 ----
- if (!fore_color) fore_Pixel = BlackPixelOfScreen(SCRN);
- if (!back_color) back_Pixel = WhitePixelOfScreen(SCRN);
- }
- + if (!brdr_color) brdr_Pixel = fore_Pixel;
- {
- XGCValues values;
- Pixel set_bits = (Pixel) (fore_Pixel & ~back_Pixel);
- ***************
- *** 2270,2278 ****
- #ifdef BUTTONS
- temp_args3[0].value = (XtArgVal) (page_w + XTRA_WID < screen_w ?
- page_w + XTRA_WID : screen_w);
- ! #else BUTTONS
- temp_args3[0].value = (XtArgVal) (page_w<screen_w ? page_w : screen_w);
- ! #endif BUTTONS
- temp_args3[1].value = (XtArgVal) (page_h<screen_h ? page_h : screen_h);
- temp_args3[2].value = (XtArgVal) (XCreateBitmapFromData(DISP,
- RootWindowOfScreen(SCRN),
- --- 2311,2319 ----
- #ifdef BUTTONS
- temp_args3[0].value = (XtArgVal) (page_w + XTRA_WID < screen_w ?
- page_w + XTRA_WID : screen_w);
- ! #else
- temp_args3[0].value = (XtArgVal) (page_w<screen_w ? page_w : screen_w);
- ! #endif
- temp_args3[1].value = (XtArgVal) (page_h<screen_h ? page_h : screen_h);
- temp_args3[2].value = (XtArgVal) (XCreateBitmapFromData(DISP,
- RootWindowOfScreen(SCRN),
- ***************
- *** 2309,2318 ****
- command_args, XtNumber(command_args));
- }
- }
- ! #else BUTTONS
- vport_widget = XtCreateManagedWidget("vport", viewportWidgetClass,
- top_level, vport_args, XtNumber(vport_args));
- ! #endif BUTTONS
- clip_widget = XtNameToWidget(vport_widget, "clip");
- draw_args[0].value = (XtArgVal) page_w;
- draw_args[1].value = (XtArgVal) page_h;
- --- 2350,2359 ----
- command_args, XtNumber(command_args));
- }
- }
- ! #else /* !BUTTONS */
- vport_widget = XtCreateManagedWidget("vport", viewportWidgetClass,
- top_level, vport_args, XtNumber(vport_args));
- ! #endif /* BUTTONS */
- clip_widget = XtNameToWidget(vport_widget, "clip");
- draw_args[0].value = (XtArgVal) page_w;
- draw_args[1].value = (XtArgVal) page_h;
- ***************
- *** 2339,2345 ****
-
- curr.win = mane.win = (caddr_t) XtWindow(draw_widget);
-
- ! #else TOOLKIT
-
- /*
- * X11 windows (non toolkit)
- --- 2380,2386 ----
-
- curr.win = mane.win = (caddr_t) XtWindow(draw_widget);
-
- ! #else /* !TOOLKIT */
-
- /*
- * X11 windows (non toolkit)
- ***************
- *** 2379,2385 ****
- size_hints.height = window_h;
- top_level = XCreateSimpleWindow(DISP, RootWindowOfScreen(SCRN),
- size_hints.x, size_hints.y, window_w, window_h, bwidth,
- ! fore_Pixel, back_Pixel);
- XSetStandardProperties(DISP, top_level, dvi_name, prog, NULL,
- argv, argc, &size_hints);
-
- --- 2420,2426 ----
- size_hints.height = window_h;
- top_level = XCreateSimpleWindow(DISP, RootWindowOfScreen(SCRN),
- size_hints.x, size_hints.y, window_w, window_h, bwidth,
- ! brdr_Pixel, back_Pixel);
- XSetStandardProperties(DISP, top_level, dvi_name, prog, NULL,
- argv, argc, &size_hints);
-
- ***************
- *** 2402,2408 ****
- XMapWindow(DISP, top_level);
- Flush();
-
- ! #endif TOOLKIT
-
- image = XCreateImage(DISP, DefaultVisualOfScreen(SCRN), 1, XYBitmap, 0,
- (char *)NULL, 0, 0, BITS_PER_BMUNIT, 0);
- --- 2443,2449 ----
- XMapWindow(DISP, top_level);
- Flush();
-
- ! #endif /* TOOLKIT */
-
- image = XCreateImage(DISP, DefaultVisualOfScreen(SCRN), 1, XYBitmap, 0,
- (char *)NULL, 0, 0, BITS_PER_BMUNIT, 0);
- ***************
- *** 2409,2423 ****
- image->bitmap_unit = BITS_PER_BMUNIT;
- #ifndef MSBITFIRST
- image->bitmap_bit_order = LSBFirst;
- ! #else MSBITFIRST
- image->bitmap_bit_order = MSBFirst;
- ! #endif MSBITFIRST
- {
- short endian = MSBFirst << 8 | LSBFirst;
- image->byte_order = *((char *) &endian);
- }
-
- ! #else X10
-
- /*
- * X10 colors
- --- 2450,2464 ----
- image->bitmap_unit = BITS_PER_BMUNIT;
- #ifndef MSBITFIRST
- image->bitmap_bit_order = LSBFirst;
- ! #else
- image->bitmap_bit_order = MSBFirst;
- ! #endif
- {
- short endian = MSBFirst << 8 | LSBFirst;
- image->byte_order = *((char *) &endian);
- }
-
- ! #else /* X10 */
-
- /*
- * X10 colors
- ***************
- *** 2449,2460 ****
- backpix = cdef.pixel;
- backmap = XMakeTile(backpix);
- }
- - if (high_color && XParseColor(high_color, &cdef) &&
- - XGetHardwareColor(&cdef))
- - highGC = cdef.pixel;
- if (brdr_color && XParseColor(brdr_color, &cdef) &&
- XGetHardwareColor(&cdef))
- bdrmap = XMakeTile(cdef.pixel);
- if (curs_color && XParseColor(curs_color, &cdef) &&
- XGetHardwareColor(&cdef))
- mouspix = cdef.pixel;
- --- 2490,2501 ----
- backpix = cdef.pixel;
- backmap = XMakeTile(backpix);
- }
- if (brdr_color && XParseColor(brdr_color, &cdef) &&
- XGetHardwareColor(&cdef))
- bdrmap = XMakeTile(cdef.pixel);
- + if (high_color && XParseColor(high_color, &cdef) &&
- + XGetHardwareColor(&cdef))
- + highGC = cdef.pixel;
- if (curs_color && XParseColor(curs_color, &cdef) &&
- XGetHardwareColor(&cdef))
- mouspix = cdef.pixel;
- ***************
- *** 2489,2495 ****
- XDefineCursor(top_level,
- XCreateCursor(xdvi_width, xdvi_height, xdvi_bits, xdvi_mask_bits,
- xdvi_x_hot, xdvi_y_hot, mouspix, backpix, GXcopy));
- ! #endif X10
-
- do_pages();
- }
- --- 2530,2536 ----
- XDefineCursor(top_level,
- XCreateCursor(xdvi_width, xdvi_height, xdvi_bits, xdvi_mask_bits,
- xdvi_x_hot, xdvi_y_hot, mouspix, backpix, GXcopy));
- ! #endif /* X10 */
-
- do_pages();
- }
- diff -cr old/xdvi.h new/xdvi.h
- *** old/xdvi.h Mon May 7 18:48:42 1990
- --- new/xdvi.h Sun May 6 18:52:18 1990
- ***************
- *** 5,11 ****
-
- #ifndef X10
- #include <X11/Xos.h> /* same as below */
- ! #else X10
- #include <sys/types.h> /* for sites without X11 */
- #ifdef SYSV
- #include <string.h>
- --- 5,11 ----
-
- #ifndef X10
- #include <X11/Xos.h> /* same as below */
- ! #else /* X10 */
- #include <sys/types.h> /* for sites without X11 */
- #ifdef SYSV
- #include <string.h>
- ***************
- *** 16,22 ****
- #include <strings.h>
- #endif /* SYSV */
- #include <sys/file.h>
- ! #endif X10
-
- #ifdef VMS
- #include <string.h>
- --- 16,22 ----
- #include <strings.h>
- #endif /* SYSV */
- #include <sys/file.h>
- ! #endif /* X10 */
-
- #ifdef VMS
- #include <string.h>
- ***************
- *** 30,39 ****
- #ifndef OPEN_MODE
- #ifndef VMS
- #define OPEN_MODE "r"
- ! #else VMS
- #define OPEN_MODE "r", "ctx=stm"
- ! #endif VMS
- ! #endif OPEN_MODE
-
- #define Printf (void) printf
- #define Fprintf (void) fprintf
- --- 30,39 ----
- #ifndef OPEN_MODE
- #ifndef VMS
- #define OPEN_MODE "r"
- ! #else /* VMS */
- #define OPEN_MODE "r", "ctx=stm"
- ! #endif /* VMS */
- ! #endif /* OPEN_MODE */
-
- #define Printf (void) printf
- #define Fprintf (void) fprintf
- ***************
- *** 75,81 ****
- #undef MSBITFIRST
- #undef BMLONG
- #define BMSHORT
- ! #endif X10
-
- #ifndef SYSV
- #ifndef VMS
- --- 75,81 ----
- #undef MSBITFIRST
- #undef BMLONG
- #define BMSHORT
- ! #endif
-
- #ifndef SYSV
- #ifndef VMS
- ***************
- *** 87,103 ****
- #define BMUNIT unsigned long
- #define BITS_PER_BMUNIT 32
- #define BYTES_PER_BMUNIT 4
- ! #else BMLONG
- #ifdef BMSHORT
- #define BMUNIT unsigned short
- #define BITS_PER_BMUNIT 16
- #define BYTES_PER_BMUNIT 2
- ! #else BMSHORT
- #define BMUNIT unsigned char
- #define BITS_PER_BMUNIT 8
- #define BYTES_PER_BMUNIT 1
- ! #endif BMSHORT
- ! #endif BMLONG
-
- #define ADD(a, b) ((BMUNIT *) (((char *) a) + b))
- #define SUB(a, b) ((BMUNIT *) (((char *) a) - b))
- --- 87,103 ----
- #define BMUNIT unsigned long
- #define BITS_PER_BMUNIT 32
- #define BYTES_PER_BMUNIT 4
- ! #else /* BMLONG */
- #ifdef BMSHORT
- #define BMUNIT unsigned short
- #define BITS_PER_BMUNIT 16
- #define BYTES_PER_BMUNIT 2
- ! #else /* BMSHORT */
- #define BMUNIT unsigned char
- #define BITS_PER_BMUNIT 8
- #define BYTES_PER_BMUNIT 1
- ! #endif /* BMSHORT */
- ! #endif /* BMLONG */
-
- #define ADD(a, b) ((BMUNIT *) (((char *) a) + b))
- #define SUB(a, b) ((BMUNIT *) (((char *) a) - b))
- diff -cr old/xdvi_man.sed new/xdvi_man.sed
- *** old/xdvi_man.sed Mon May 7 18:48:46 1990
- --- new/xdvi_man.sed Thu May 10 20:15:19 1990
- ***************
- *** 1,7 ****
- #ifx11
- ! .TH XDVI SIPB "8 May 1989" "X Version 11"
- #ifx10
- ! .TH XDVI SIPB "8 May 1989" "X Version 10"
- #endif
- .SH NAME
- xdvi \- DVI Previewer for the X Window System
- --- 1,7 ----
- #ifx11
- ! .TH XDVI 1 "27 March 1990" "X Version 11"
- #ifx10
- ! .TH XDVI 1 "27 March 1990" "X Version 10"
- #endif
- .SH NAME
- xdvi \- DVI Previewer for the X Window System
- ***************
- *** 8,21 ****
- .SH SYNOPSIS
- .B xdvi
- .nh
- ! [+[\fIpage\fP]] [\-s \fIshrink\fP] [\-S \fIdensity\fP] [\-p \fIpixels\fP]
- ! [\-l] [\-rv] [\-fg \fIcolor\fP] [\-bg \fIcolor\fP]
- ! [\-hl \fIcolor\fP] [\-bd \fIcolor\fP] [\-cr \fIcolor\fP]
- ! [\-margins \fIinches\fP] [\-sidemargin \fIinches\fP] [\-topmargin \fIinches\fP]
- [\-paper \fIpapertype\fP] [\-mgs[\fIn\fP] \fIsize\fP] [\-altfont \fIfont\fP]
- #ifx11
- ! [#\fIgeometry\fP] [\-geometry \fIgeometry\fP] [\-display \fIdisplay\fP]
- ! [-copy] [-thorough]
- #ifx10
- [\-geometry \fIgeometry\fP | =\fIgeometry\fP]
- [\-display \fIhost\fP:\fIdisplay\fP | \fIhost\fP:\fIdisplay\fP]
- --- 8,21 ----
- .SH SYNOPSIS
- .B xdvi
- .nh
- ! [+[\fIpage\fP]] [\-s \fIshrink\fP] [\-S \fIdensity\fP] [\-p \fIpixels\fP] [\-l]
- [\-paper \fIpapertype\fP] [\-mgs[\fIn\fP] \fIsize\fP] [\-altfont \fIfont\fP]
- + [\-margins \fIinches\fP] [\-sidemargin \fIinches\fP] [\-topmargin \fIinches\fP]
- + [\-rv] [\-fg \fIcolor\fP] [\-bg \fIcolor\fP]
- + [\-hl \fIcolor\fP] [\-bd \fIcolor\fP] [\-cr \fIcolor\fP] [\-bw \fIwidth\fP]
- #ifx11
- ! [\-geometry \fIgeometry\fP] [-icongeometry \fIgeometry\fP] [-iconic]
- ! [\-display \fIdisplay\fP] [-copy] [-thorough]
- #ifx10
- [\-geometry \fIgeometry\fP | =\fIgeometry\fP]
- [\-display \fIhost\fP:\fIdisplay\fP | \fIhost\fP:\fIdisplay\fP]
- ***************
- *** 73,78 ****
- --- 73,81 ----
- Determines the density used when shrinking bitmaps for fonts.
- A higher value produces a lighter font. The default value is 40.
- .TP
- + .BI \-density " density"
- + Same as \fB-S\fR.
- + .TP
- .BI \-p " pixels"
- (%%dot%%pixelsPerInch)
- Defines the size of the fonts to use, in pixels per inch. The
- ***************
- *** 97,103 ****
- Specifies the width of the border of the window.
- .TP
- .BI \-borderwidth " width"
- ! Same as \fB-bw\fR, above.
- .TP
- .BI \-fg " color"
- (%%dot%%foreground)
- --- 100,106 ----
- Specifies the width of the border of the window.
- .TP
- .BI \-borderwidth " width"
- ! Same as \fB-bw\fR.
- .TP
- .BI \-fg " color"
- (%%dot%%foreground)
- ***************
- *** 104,110 ****
- Determines the color of the text (foreground).
- .TP
- .BI \-foreground " color"
- ! Same as \fB-fg\fR, above.
- .TP
- .BI \-bg " color"
- (%%dot%%background)
- --- 107,113 ----
- Determines the color of the text (foreground).
- .TP
- .BI \-foreground " color"
- ! Same as \fB-fg\fR.
- .TP
- .BI \-bg " color"
- (%%dot%%background)
- ***************
- *** 111,130 ****
- Determines the color of the background.
- .TP
- .BI \-background " color"
- ! Same as \fB-bg\fR, above.
- .TP
- .BI \-hl " color"
- (%%dot%%highlight)
- ! Determines the color of the page border.
- .TP
- .BI \-bd " color"
- (%%dot%%borderColor)
- Determines the color of the window border.
- .TP
- .BI \-cr " color"
- (%%dot%%cursorColor)
- ! Determines the color of the cursor. The default is the
- ! foreground color.
- #ifx11
- .TP
- .B \-thorough
- --- 114,136 ----
- Determines the color of the background.
- .TP
- .BI \-background " color"
- ! Same as \fB-bg\fR.
- .TP
- .BI \-hl " color"
- (%%dot%%highlight)
- ! Determines the color of the page border. The default is the foreground color.
- .TP
- .BI \-bd " color"
- (%%dot%%borderColor)
- Determines the color of the window border.
- .TP
- + .BI \-bordercolor " color"
- + Same as \fB-bd\fR.
- + .TP
- .BI \-cr " color"
- (%%dot%%cursorColor)
- ! Determines the color of the cursor. The default is the color of the page
- ! border.
- #ifx11
- .TP
- .B \-thorough
- ***************
- *** 184,190 ****
- 350, 600, 900, and 1200.
- .TP
- .BI \-mgs " size"
- ! Same as \fB-mgs1\fR, above.
- #ifx10
- .BI \-mgs " size"
- (magnifierSize1)
- --- 190,196 ----
- 350, 600, 900, and 1200.
- .TP
- .BI \-mgs " size"
- ! Same as \fB-mgs1\fR.
- #ifx10
- .BI \-mgs " size"
- (magnifierSize1)
- ***************
- *** 192,198 ****
- for the left button. See the MOUSE ACTIONS section. Default is 200.
- .TP
- .BI \-mgs1 " size"
- ! Same as \fB-mgs\fR, above.
- .TP
- .BI \-mgs2 " size"
- (magnifierSize2)
- --- 198,204 ----
- for the left button. See the MOUSE ACTIONS section. Default is 200.
- .TP
- .BI \-mgs1 " size"
- ! Same as \fB-mgs\fR.
- .TP
- .BI \-mgs2 " size"
- (magnifierSize2)
- ***************
- *** 210,218 ****
- (*geometry)
- Specifies the initial geometry of the window.
- .TP
- ! .BI # geometry
- (%%dot%%iconGeometry)
- Specifies the initial position for the icon.
- #ifx10
- .BI = geometry
- (geometry)
- --- 216,229 ----
- (*geometry)
- Specifies the initial geometry of the window.
- .TP
- ! .BI \-icongeometry " geometry
- (%%dot%%iconGeometry)
- Specifies the initial position for the icon.
- + .TP
- + .B \-iconic
- + (%%dot%%iconic)
- + Causes the XDVI window to start in the iconic state. The default is to
- + start with the window open.
- #ifx10
- .BI = geometry
- (geometry)
- ***************
- *** 256,274 ****
- .B ^
- Move to the ``home'' position of the page. This is normally the upper
- left-hand corner of the page, depending on the margins as described in
- ! the \-margins option, above.
- .TP
- .B u
- ! Moves up a window-full.
- .TP
- .B d
- ! Moves down a window-full.
- .TP
- .B l
- ! Moves left a window-full.
- .TP
- .B r
- ! Moves right a window-full.
- .TP
- .B c
- Moves the page so that the point currently beneath the cursor is moved to
- --- 267,285 ----
- .B ^
- Move to the ``home'' position of the page. This is normally the upper
- left-hand corner of the page, depending on the margins as described in
- ! the \-\fBmargins\fR option, above.
- .TP
- .B u
- ! Moves up two thirds of a window-full.
- .TP
- .B d
- ! Moves down two thirds of a window-full.
- .TP
- .B l
- ! Moves left two thirds of a window-full.
- .TP
- .B r
- ! Moves right two thirds of a window-full.
- .TP
- .B c
- Moves the page so that the point currently beneath the cursor is moved to
- ***************
- *** 276,282 ****
- .TP
- .B M
- Sets the margins so that the point currently under the cursor is the upper
- ! left-hand corner of the text in the page.
- .TP
- .B s
- Changes the shrink factor to the given number. If no number is given, the
- --- 287,295 ----
- .TP
- .B M
- Sets the margins so that the point currently under the cursor is the upper
- ! left-hand corner of the text in the page. Note that this command itself does
- ! not move the image at all. For details on how the margins are used, see
- ! the \-\fBmargins\fR option.
- .TP
- .B s
- Changes the shrink factor to the given number. If no number is given, the
- ***************
- *** 301,307 ****
- any mouse button will pop up a ``magnifying glass'' which shows the unshrunk
- image in the vicinity of the mouse click. This subwindow disappears when
- the mouse button is released. Different mouse buttons produce different sized
- ! windows, as indicated by the \fB\-mgs\fR option, above. Moving the cursor
- while holding the button down will move the magnifying glass.
- .PP
- Also, the scrollbars (if present) behave in the standard way: pushing Button 2
- --- 314,320 ----
- any mouse button will pop up a ``magnifying glass'' which shows the unshrunk
- image in the vicinity of the mouse click. This subwindow disappears when
- the mouse button is released. Different mouse buttons produce different sized
- ! windows, as indicated by the \fB\-mgs\fR option. Moving the cursor
- while holding the button down will move the magnifying glass.
- .PP
- Also, the scrollbars (if present) behave in the standard way: pushing Button 2
- dan
- ----------------------------------------------------
- O'Reilly && Associates argv@sun.com / argv@ora.com
- Opinions expressed reflect those of the author only.
-